home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
art&graf.ix
/
art-0035
/
mset.txt
< prev
next >
Wrap
Text File
|
1997-04-16
|
14KB
|
236 lines
MANDLEBROT ADVENTURER
---------------------
The Mandlebrot Adventurer is a program with which you can delve into
what is reckoned to be the most complicated mathematical object known!
The Mandlebrot set is named after Benoit B. Mandlebrot, a research
fellow at the I.B.M. Thomas J. Watson Research Center in Yorktown Heights,
N.Y. He has worked and developed the mathematical field known as fractal
geometry; the small boundry area around the Mandlebrot set is a fractal.
This is the area we are interested in. All the points which lie
within the set, by convention, are coloured black and play no real part in
our investigations. As we move further away from the boundry the picture
becomes more and more bland.
In the boundry area we find immense complexity - infinite complexity,
because if we had sufficient computing power we would find no end to it.
The patterns have an organic feel of tendrils and whorls all connected to
each other and amongst them are to be found smaller Mandlebrot sets none
quite like any of the others. Each of which can be explored in it's own
right.
The patterns are calculated using the formula:
z² + c
Where z is a complex number that is allowed to vary and c is a
certain fixed complex number. (The point co-ordinates.)
Initally set z to zero so the first result is:
0² plus c = just c
Now substitute this result for z and do the calculation again.
c² + c and again:
( c² + c )² +c
This calculation is carried out repeatedly until the value of two is
reached (this means it lies outside of the Mandlebrot set) or until the
pre-set maximum number of iterations has been reached.
It is the number of iterations for each point which will determine
the colour and pattern each picture takes on. The maximum iteration value
can be fairly low for points lying away from the set and rising rapidly
the nearer you get. For most pictures a Max val of 100 - 500 is sufficient
but for high precision a Max val of 1000 - 2000 or even greater may be
needed. (If all the points within the picture lie outside of the
Mandlebrot set then Max val may not be reached.)
How to use Mandlebrot Adventurer.
The ORIGINAL.SET file must remain with the program file MSET.PRG for
the program to run. Select low resolution and double click on MSET.PRG.
After loading the program, the screen will show the usual GEM menu
bar and options. Beneath the menu bar is a picture of the ORIGINAL.SET and
to the right is the title box.
When a new picture is calculated it is related to the parent file.
This enables you to go backwards and forwards through the generations.
So using the FORWARD GENERATION option under M.SET a list of children
will appear in the righthand box and the area which has been magnified
will be outlined on the parent set. By selecting different children each
area will be outlined in turn. Once a choice has been made click on load.
To return to the parent set select BACK GENERATION.
To return to the original Mandlebrot set select ORIGINAL.
If the set to be loaded is not on the current disk a warning is
displayed, giving you the option of changing it for the correct one.
Up to four sets can be held in memory at once on a 520 ST, more with
greater memory capacity. Any memory used by desk top accessories will
reduce this number and as there isn't any need for them it is best not to
use them. Also they will reduce the number of set files a disk can hold.
To find out which sets are on the current disk or to load unrelated
sets select the LOAD option under FILE. In the right hand box a catalogue
is displayed, click on the required set file then click on OK. To
catalogue more than one disk, insert the next disk and click in the top
load title box.
Having found a set you wish to investigate further select the
CALCULATE option. Displayed in the right hand box will be found the values
that were used to calculate the current set. Starting at the top:-
Size This is the size in pixels. Normally 180. Smaller
pictures can be produced if so desired. Minimum size
is 40 X 40. Maximum is 180 X 180. To change the values
click on the up or down arrows.
Max val See introduction on how the formula is calculated.
Adjust Max val according to precision required, if a
large area of the Mandlebrot set is included in the
picture and a high Max val is given then expect a long
calculation time. Minimum 16, maximum 9999.
Display values Once selected and calculation started the point values
and X and Y co-ordinates are displayed. (Co-odinate
0,0 is the top left corner.) A handy way of
seeing how things are going and how far into the
calculations you are; allowing a guesstimate of the
time remaining. The big drawback is the extra time
used in displaying the values - over 90,000 system
calls to print them! (3 for each point.) About 18
minutes. This option can be turned on and off during
calculations - see Esc.
Maths accuracy There is a choice of 3 levels of mathematical accuracy
Level 1 is sufficient for most pictures, higher levels
are needed the deeper you delve. (I've yet to use
level 3!) Warnings are given when the accuracy starts
to run out and has run out, you are then given the
option of changing the level. Higher levels will take
longer. Fixed point maths routines are used ( 100%
optimised machine code ), giving 12 digits after the
decimal point with level 1,17 digits with level 2 and
26 with level 3. Using 6,8 and 12 bytes respectively.
Start Click on this when ready to start calculations, don't
forget to choose the area to magnify.
Restart Only available after halting the calculations.
Cancel Return to menu. Any incomplete calculations are lost.
Esc Calculations can be halted by pressing the Esc key, to
continue click on Restart. Max val, Display values and
Maths accuracy can be changed during the halt.
To select the area to magnify position the mouse at the imaginary top
left hand corner of a box and hold down the left button. Now drag down and
to the right a roughly square box, until the desired size is reached then
release the left button. If the box isn't in the correct position, it can
be repositioned by moving the mouse into the box and holding down the left
button. Holding the button down drag the box to the desired position. To
erase the box click the right button.
When the area to be magnified has been boxed and the other options
have been set click on start. Nothing will happen (unless the Display
values option has been selected) until the calculations are finished. Once
finished the new area is displayed and a name is requested before you are
allowed to carry on. The set is saved onto disk and the parent file is
updated, so that relationships are maintained. The time taken to complete
the calculations varies according to several factors:
1. The Size in pixels. Obviously related to the number of points to be
calculated.
2. The level of Maths accuracy. Level 2 takes about half as long again
as level 1 and level 3 takes nearly twice as long as level 2 to calculate
the same set. So it's best to use the lowest level posible.
3. The value of Max val. Keep this within reasonable limits as low as
possible. If it's too low then picture quality will suffer, too high and
areas of the Mandlebrot set are included in the box then time will be
wasted in unnecessary calculations. After a few times experience will show
the right value to use. (Look at some of the sets supplied on the disk as
a guide.)
4. The distance from the Mandlebrot set. This is the most critical
factor in determining the calculation time, as 2 and 3 have to rise the
nearer to the Mandlebrot set you go. i.e. The closer you approach the
boundary with the Mandlebrot set the higher the point values become and
increasing magnification is needed requiring higher levels of accuracy.
Unfortunately these are also the best places to look.
It's hard to give an average calculation time but as can be seen from
the above factors the deeper in you travel the longer it takes. The
original set can be calculated in under 4 minutes. A more realistic time
for most calculations is between 10 - 20 minutes, but it is posible to
wait an hour or more!
To change the colour boundaries and the colours select DISPLAY. It is
posible to change previously calculated sets just by loading then in.
The right hand box will have two columns Val and Col, to the right
are the colours that are available, each is numbered between 0-9 and A-F,
sixteen in all. (Upper case A-F.) Below the colours are three selection
boxes:
Display will re-display the set with any changes that have been made.
OK will return you to the menu.
Colours will allow you to change the colours.
The values and colours used in any set can be seen by selecting
DISPLAY, this will give a good idea of typical values used.
Displaying the set in an imaginative and artistic way is probably the
most dificult part of the program. And of course personal tastes differ.
The two columns can have a maximum of twenty one pairs of values and
colours, each value is linked to it's colour. All points with a value less
than or equal to the first value will be displayed in it's associated
colour, all points with a value greater than the first but less than or
equal to the second value will be displayed in it's associated colour, and
so on down the list. The easiest way is by trial and error until a
satisfactory picture is found. Setting up the colour boundaries before
finalising the colours and using contrasting colours for each value
boundary helps to start with.
The number of value / colour pairs to use depends upon how you want
your picture to look. It can be effective using only a handful of colours
or if shading is wanted then all twenty one might be used.
To change the colours click on the Colours box, (having first
selected DISPLAY of course.) The right hand box will still show the
colours plus a larger box showing the selected colour to change. To select
a colour click on any of the numbered boxes. Above the large box are the
Red, Green and Blue values for that colour, to change them click on the up
or down arrows.
If you wish to keep the original colours and forget any changes that
have been made then click on cancel.
When satisfied with the colours clicking on OK will return you to the
DISPLAY panel. Any changes to the colours will take immediate effect on
the picture and the screen as the system colour palette is changed. This
means any changes to Black or White (0 or F) may make reading the text
difficult.
IMPORTANT.
----------
When all the changes have been made the set file must be updated or
they will be lost. To do this select SAVE under FILE, no name has to be
given as this is remembered by the program.
SAVE can be used any number of times, so multiple changes can be made
to any of the files - even the Original.
SAVE AS ... is used when you wish to save a copy of any set file,
this enables different pictures to be made of the same set. A new name is
requested as a new file is created. The old file is untouched.
DELETE will erase a set file from the disk. It is not possible to
delete a parent file as this would upset the relationships to it's
children. If files are erased from the desk top this might confuse the
program.
HINTS AND TIPS.
---------------
Turn the Display values option off except for quick looks.
Don't forget to save any changes made.
Keep a supply of empty disks available otherwise you will lose your
calculations.
Use caps lock during DISPLAY.
Some interesting places to look are in the cracks and other smaller
Mandlebrot sets. But find your own places.
Any suggestions on improving the progam or if you find any bugs
(heaven forbid) don't hesitate to contact me. Listings are also available,
the whole program has been written in assembler using Hisoft DevpacST.